import request from "@/utils/request";

// 上传文件
export function uploadFile(file) {
	const formData = new FormData();
	formData.append("file", file);

	return request.post("/uploads", formData, {
		headers: {
			"Content-Type": "multipart/form-data",
		},
	});
}

// 获取上传文件列表
export function getUploadList() {
	return request.get("/uploads");
}

// 获取单个上传文件详情
export function getUploadDetail(id) {
	return request.get(`/uploads/${id}`);
}

// 删除上传文件
export function deleteUpload(id) {
	return request.delete(`/uploads/${id}`);
}
